<?php

namespace Frieza\Modules\Article\Controllers;

use App\Http\Controllers\Controller;
use Doraemon\tools\Area;
use Illuminate\Http\Request;


class IndexController extends Controller
{
    /**
     * 废弃
     * 获取子地区用新的 admin/extend/area/get/{pid?}
     * @deprecated
     *
     */
    public function area1(Request $request)
    {
        $pid = $request->input('q', 0);
        $areas = Area::getLocation($pid);
        $format = array_map(function($k, $v){
            return [
                'id' => $k,
                'text' => $v,
            ];
        }, array_keys($areas), $areas);
        return response()->json($format);
    }

    public function  searchTag(Request $request){
        //中心词
        $rs = [];

        return $rs;
    }

}
